package jrain.flow.engine.node;

import jrain.flow.engine.bean.NodeInstance;
import jrain.flow.engine.uitls.FlowConst;

public class NodeServiceImpl implements NodeService {

	@Override
	public void doNode(NodeInstance nodeInstance) {

		// @TODO 记录开始节点
		if (FlowConst.NODE_TYPE_START == nodeInstance.getNodeDef().getNodeType()) {
			doNodeSplit(nodeInstance);
		} else if (FlowConst.NODE_TYPE_AUTO == nodeInstance.getNodeDef().getNodeType()) {
			doNodeSplit(nodeInstance);
		} else {
			// @TODO 结束流程
		}
	}

	@Override
	public void doNodeSplit(NodeInstance nodeInstance) {
		// 结束节点
		// List<ConnDef> list =nodeInstance.getNodeDef().getOuputs();
		// for (ConnDef connDef : list) {
		//
		// }
		// FlowUtils.getDispatchService().doNodeJoin(nodeInstance);
	}

	@Override
	public void doNodeJoin(NodeInstance nodeInstance) {
		// 合并节点

	}

}
